
public class MaximumSubarray {
	public int maxSubArray(int[] A) {
        int max = Integer.MIN_VALUE;
        int current = 0;
        for(int i =0 ; i < A.length ; i ++)
        {
            current = current + A[i];
            
            if(max < current) max = current;
            if(current < 0) current = 0;
        }
        
        return max;
    }
}
